package com.ftg.learn.chapter07;

import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;

/**
 * @author KangJx
 * @date 2021/7/13
 */
public class HomeWork {

    public void quest1(){
        for(int i = 1,len = 5;i < len;i++){
            for(int j =1,jlen=7;j < jlen;j++){
                switch (i){
                    case 1:
                        System.out.print(j+"\t");
                        break;
                    case 2:
                        System.out.print(2*jlen-1-j + "\t");
                        break;
                    case 3:
                        System.out.print(2*jlen-2+j+"\t");
                        break;
                    case 4:
                        System.out.print(4*jlen-3-j+"\t");
                        break;
                }
            }
            System.out.println();
        }
    }

    public void quest3(){
        for(int i = 1;i < 5;i++){
            for(int j = 0;j < 6;j++){
                switch (i){
                    case 1 :
                        System.out.println(j+1+"\t");
                        break;
                    case 2:
                        System.out.println(i*6 - j+"\t");
                        break;
                    case 3:
                        System.out.println(i*6-6+1+j+"\t");
//                        System.out.println((i-1)*6 + 1 + j+"\t");
                    case 4:
                        System.out.println(i*6 - j+"\t");
                        break;
                }
            }
        }
    }

    public void quest2(){
        //6行
        for(int i = 1,len = 6;i <= len;i++) {
            //7列
            for (int j = 1, jlen = 7; j <= jlen; j++) {
                System.out.print(i == 1 ? j +"\t": (i % 2 == 0 ? (i)*jlen-j+1:(i-1)*jlen+j)+"\t");
            }
            System.out.println();
        }
    }


}
